enum TransactionType {
    CARD_PAYMENT,
    SBP_PAYMENT,
    CASH_PURCHASE,
    CHEQUE,
    WITHDRAWAL,
    CACHIER,
    DEPOSIT,
    TRANSFER,
    SBP_TRANSFER,
    INTEREST,
    DIVIDEND,
    DIRECT_BILLING,
    CHARGE,
    FEE,
    INCOME,
    SALE,
    REFUND,
    UNDEFINED
}

type Transaction {
    uuid: ID!,
    amount: BigDecimal!,
    creditAmount: BigDecimal!,
    transactionDate: Date!,
    type: TransactionType!,
    comment: String,
    checked: Boolean!,
    accountDebited: Account!,
    accountCredited: Account!,
    contact: Contact,
    invoiceNumber: String,
    parent: Transaction,
    detailed: Boolean!,
    statementDate: Date,
    created: Long!,
    modified: Long!
}

input TransactionInput {
    amount: BigDecimal!,
    creditAmount: BigDecimal!,
    transactionDate: Date!,
    type: TransactionType!,
    comment: String!,
    checked: Boolean!,
    accountDebitedUuid: String!,
    accountCreditedUuid: String!,
    contactUuid: String,
    contactName: String,
    invoiceNumber: String!,
    parentUuid: String,
    detailed: Boolean!,
    statementDate: Date
}

type TransactionResponse {
    transaction: Transaction!,
    contact: Contact,
    accounts: [Account]!
}
